<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app"></div>
    <script src="../vuejs/vue.js"></script>
    <template id="my-app">
        <div :style="{color:finalColor,'font-size':'20px'}">{{message}}</div>
        <div :style="{color:finalColor,fontSize:finalFontSize+'px'}">{{message}}</div>
        <!-- 绑定一个data中地属性值，并且是一个对象 -->
        <div :style="styleObj">{{message}}</div>
        <!-- 绑定一个方法 -->
        <div :style="getStyleObj()">{{message}}</div>



    </template>
    <script>
        Vue.createApp({
            template:`#my-app`,
            data(){
                return{
                    message:'哈哈哈哈',
                    finalColor:'red',
                    finalFontSize:50,
                    styleObj:{
                        'font-size':'40px',
                        fontWeight:700,
                        background:'red'
                    }
                }
            },
            methods:{
                getStyleObj(){
                    return {
                        'font-size':'40px',
                        fontWeight:700,
                        background:'red'
                    }
                }
            }

        }).mount('#app')
    </script>
</body>
</html>